Update oXs_out_frsky.cpp
[openXsensor.git] / oXs_Configurator / Python 37 Sources / oxsMagnet.py
blob7b318967bec840dc3e05ead892afba97b8500be7
1 #from tkinter import StringVar
2 from oxsConfig import ttk , W , E , fMagnet, GeneratemagCalData, xMagOffsetVar, yMagOffsetVar, zMagOffsetVar
3 from oxsConfig import xxMagCorrectionVar, xyMagCorrectionVar, xzMagCorrectionVar, yxMagCorrectionVar, yyMagCorrectionVar, yzMagCorrectionVar, zxMagCorrectionVar, zyMagCorrectionVar, zzMagCorrectionVar
6 #define GENERATE_MAG_CALIBRATION_DATA // uncomment this line when HMC5883 calibration has to be performed. Set back as comment once calibration parameters have been introduced
8 #define XMAG_OFFSET 2.4683 // must be an integer
9 #define YMAG_OFFSET -1.3694 // must be an integer
10 #define ZMAG_OFFSET 138.9683 // must be an integer
11 #define XXMAG_CORRECTION 0.122082 // can have decimals
12 #define XYMAG_CORRECTION -0.00204026
13 #define XZMAG_CORRECTION 0.00377534
14 #define YXMAG_CORRECTION -0.00204026
15 #define YYMAG_CORRECTION 0.130413
16 #define YZMAG_CORRECTION -0.00491189
17 #define ZXMAG_CORRECTION 0.00377534
18 #define ZYMAG_CORRECTION -0.00491189
19 #define ZZMAG_CORRECTION 0.138038
21 fMagnet.grid(column= 1 , row=8) #by default make it visible
23 ttk.Checkbutton(fMagnet, text='Generate MAG Calibration data', variable=GeneratemagCalData,
24 onvalue='On', offvalue='Off').grid(column=0, row=0, columnspan = 8, sticky=(W,E), padx=15 , pady=(10,2))
25 ttk.Label(fMagnet, text="XMAG_OFFSET" ).grid(column= 0, row=1, padx= (15,5), pady=5 , sticky=(W))
26 ttk.Label(fMagnet, text="YMAG_OFFSET" ).grid(column= 0, row=2, padx= (15,5), pady=5 , sticky=(W))
27 ttk.Label(fMagnet, text="ZMAG_OFFSET" ).grid(column= 0, row=3, padx= (15,5), pady=5 , sticky=(W))
28 ttk.Label(fMagnet, text="XXMAG_CORRECTION" ).grid(column= 0, row=4, padx= (15,5), pady=5 , sticky=(W))
29 ttk.Label(fMagnet, text="XYMAG_CORRECTION" ).grid(column= 0, row=5, padx= (15,5), pady=5 , sticky=(W))
30 ttk.Label(fMagnet, text="XZMAG_CORRECTION" ).grid(column= 0, row=6, padx= (15,5), pady=5 , sticky=(W))
31 ttk.Label(fMagnet, text="YXMAG_CORRECTION" ).grid(column= 0, row=7, padx= (15,5), pady=5 , sticky=(W))
32 ttk.Label(fMagnet, text="YYMAG_CORRECTION" ).grid(column= 0, row=8, padx= (15,5), pady=5 , sticky=(W))
33 ttk.Label(fMagnet, text="YZMAG_CORRECTION" ).grid(column= 0, row=9, padx= (15,5), pady=5 , sticky=(W))
34 ttk.Label(fMagnet, text="ZXMAG_CORRECTION" ).grid(column= 0, row=10, padx= (15,5), pady=5 , sticky=(W))
35 ttk.Label(fMagnet, text="ZYMAG_CORRECTION" ).grid(column= 0, row=11, padx= (15,5), pady=5 , sticky=(W))
36 ttk.Label(fMagnet, text="ZZMAG_CORRECTION" ).grid(column= 0, row=12, padx= (15,5), pady=5 , sticky=(W))
37 ttk.Entry(fMagnet, textvariable=xMagOffsetVar , width='5').grid(column=1 , row=1)
38 ttk.Entry(fMagnet, textvariable=yMagOffsetVar , width='5').grid(column=1 , row=2)
39 ttk.Entry(fMagnet, textvariable=zMagOffsetVar , width='5').grid(column=1 , row=3)
40 ttk.Entry(fMagnet, textvariable=xxMagCorrectionVar , width='5').grid(column=1 , row=4)
41 ttk.Entry(fMagnet, textvariable=xyMagCorrectionVar , width='5').grid(column=1 , row=5)
42 ttk.Entry(fMagnet, textvariable=xzMagCorrectionVar , width='5').grid(column=1 , row=6)
43 ttk.Entry(fMagnet, textvariable=yxMagCorrectionVar , width='5').grid(column=1 , row=7)
44 ttk.Entry(fMagnet, textvariable=yyMagCorrectionVar , width='5').grid(column=1 , row=8)
45 ttk.Entry(fMagnet, textvariable=yzMagCorrectionVar , width='5').grid(column=1 , row=9)
46 ttk.Entry(fMagnet, textvariable=zxMagCorrectionVar , width='5').grid(column=1 , row=10)
47 ttk.Entry(fMagnet, textvariable=zyMagCorrectionVar , width='5').grid(column=1 , row=11)
48 ttk.Entry(fMagnet, textvariable=zzMagCorrectionVar , width='5').grid(column=1 , row=12)